#include "GameContext.h"

#include "ComponentManager.h"
#include "ComponentManager.cpp"
#include "Renderable.h"
#include "VBOModel.h"

GameContext::GameContext(void)
{
	//initializeComponents();
}

GameContext::~GameContext(void)
{
}

void GameContext::initializeComponents()
{
	ComponentManager<Renderable>& componentManager = ComponentManager<Renderable>::getInstance();	

	{
		Renderable* renderable = new Renderable(*new VBOModel("angel.obj"));
		renderable->x = 0;
		renderable->scale = 0.5;
		componentManager.addComponent(*renderable);
	}

	{
		Renderable* renderable = new Renderable(*new VBOModel("HIV.obj"));
		renderable->x = -2;
		renderable->scale = 0.5;
		componentManager.addComponent(*renderable);
	}

	VBOModel *vboModel = new VBOModel("blood_cell.obj");

	{
		Renderable* renderable = new Renderable(*vboModel);
		renderable->x = 1.5;
		renderable->r = 1;
		renderable->g = 1;
		renderable->b = 1;
		componentManager.addComponent(*renderable);
		
	}

	{
		Renderable* renderable = new Renderable(*vboModel);
		renderable->x = 3;
		renderable->r = 1;
		renderable->g = 0;
		renderable->b = 0;
		componentManager.addComponent(*renderable);
	}

	{
		Renderable* renderable = new Renderable(*vboModel);
		renderable->x = 4.5;
		renderable->r = 1;
		renderable->g = 0.5;
		renderable->b = 0.5;
		componentManager.addComponent(*renderable);
	}

	{
		Renderable* renderable = new Renderable(*vboModel);
		renderable->x = 6;
		renderable->r = 0.5;
		renderable->g = 0.5;
		renderable->b = 0.5;
		renderable->alpha = 0.5;
		componentManager.addComponent(*renderable);
	}
}

